package com.google.code.japndroid;

import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class PacketKillerBluetoothReciever extends BroadcastReceiver {
	
	@Override
	public void onReceive(Context context, Intent intent) {
		if(BluetoothAdapter.ACTION_REQUEST_ENABLE.equals(intent.getAction())) {
			PacketKillerUtils.setEnableBlueTooth(true);
		}else if(PacketKillerConstants.BLUETOOTH_REQUEST_DISENABLE.equals(intent.getAction())){
	        PacketKillerUtils.setEnableBlueTooth(false);
		}
		
		
        /*Bundle extras = intent.getExtras();
        boolean enable = true;
        if (extras != null) {
        	enable = extras.getBoolean("enable");
        }else{
        	boolean isBlueToothActive = PacketKillerUtils.isBlueToothActive();

        	enable = (isBlueToothActive ? false : true);
        }
        */

        
        //Intent msg = new Intent(PacketKillerConstants.BLUETOOTH_STATUS_CHANGE_DONE);
        //Intent msg = new Intent(BluetoothAdapter.ACTION_STATE_CHANGED);
        //msg.putExtra("enable",enable);
        //context.sendBroadcast(msg);  
	}
}
